<?php

session_start();
require("../models/webconfig.php");
require("../models/class.connection.php");
require("../models/repositories/class.CartRepository.php");

$cartRepository = new CartRepository();
if (isset($_POST['code']) && isset($_POST['quantity'])) {
    if ($cartRepository->UpdateCart($_POST['code'], $_POST['quantity'])) {
        echo($cartRepository->GetCartCount());
    } else {
        echo "-1";
    }
}
?>
